<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>
    Web2Py cannot send emails (gmail) any more (free user) : Forums : PythonAnywhere
</title>
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="Forums : PythonAnywhere">
        <meta name="author" content="PythonAnywhere LLP">
        <meta name="google-site-verification" content="O4UxDrfcHjC44jybs2vajc1GgRkTKCTRgVzeV6I9V14" />

        <!-- Le styles -->
        <link href="/static/bootstrap/css/bootstrap.css" rel="stylesheet">
        <link href="/static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
        <link href="/static/anywhere/styles/bootstrap_base.css" rel="stylesheet">
        
    
    <link rel="stylesheet" href="/static/anywhere/styles/forums.css" type="text/css" media="screen" charset="utf-8" />

    <link rel="stylesheet" href="/static/pygments/style.css" type="text/css" media="screen" charset="utf-8" />

        <link rel="stylesheet" href="/static/jquery/jquery-ui-1.8.11.custom.css" type="text/css" media="screen" charset="utf-8" />
        
    
    <link rel="alternate" type="application/rss+xml" title="RSS" href="/forums/topic/790/rss" />

        <style type="text/css">
            body {
                height: auto;
            }
        </style>
        <!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
        <!--[if lt IE 9]>
        <script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->

        <!-- Le fav and touch icons -->
        <link rel="apple-touch-icon" href="images/apple-touch-icon.png">
        <link rel="apple-touch-icon" sizes="72x72" href="images/apple-touch-icon-72x72.png">
        <link rel="apple-touch-icon" sizes="114x114" href="images/apple-touch-icon-114x114.png">
    </head>

     <body>
        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div id="id_internal_nav_bar_container" class="container">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href="/"><img id="id_logo" src="/static/anywhere/images/logo-234x35.png" height="35" title="PythonAnywhere logo" alt="PythonAnywhere logo" /></a>
                    <div class="nav-collapse">
                        <ul id="id_header_links" class="nav">
                            <li><a id="id_feedback_link" class='feedback_link' href="">Send feedback</a></li>
                            <li><a id="id_forums_link" href="/forums/">Forums</a></li>
                            <li><a href="/wiki/" id="id_help_link">Help</a></li>
                            <li><a href="http://blog.pythonanywhere.com/" id="id_blog_link">Blog</a></li>
                            
                            
                                <li><a style="font-weight: bold;" href="/pricing/" id="id_pricing_link">Pricing & signup</a></li>
                                <li><a href="/login/?next=/forums/topic/790/" id="id_login_link">Log in</a></li>
                            
                        </ul>
                    </div>
                </div>
            </div>
        </div>

        <div class="top-container" id="id_dummy"></div>

        

        
    
    <div class="container">
        <div class="row">
            <div class="span8 offset3">
                <h1>PythonAnywhere Forums</h1>
            </div>
        </div>



    <div class="row">
        <div class="span8 offset3">
            <p>
                <a href="/forums/start_topic/" id="id_start_new_topic">Start a new topic</a> |
                <a href="/forums/">Back to all topics</a> |
                <a href="/forums/topic/790/rss">This topic's RSS</a>
            </p>
        </div>
    </div>
    <div class="row">
        <div class="span8 offset3 topic">
            <h2>Web2Py cannot send emails (gmail) any more (free user)</h2>
        </div>
    </div>

    
        <div class="row">
            <div id="id_post_5629" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5629_content_text" class="span8">
                        <p>I am testing/developing a website using webp2y on a free account for now.
Up until recently (I only found out today), sending emails from web2py worked fine. However, whenever I try to send an email now, I get:</p>
<p>Mail.send failure:[Errno 101] Network is unreachable</p>
<p>The last email I successfully sent was on July 2 (but I haven't been working on it until today - July 25).
Any ideas? I haven't changed any settings.
Thanks.</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5629_creator_details">
                            
                                
                            
                            dostal
                            |
                            4
                            posts
                            |
                            
                        </span>
                        <span id="id_post_5629_created_date">
                            July 25, 2013, 4:19 p.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5629">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5630" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5630_content_text" class="span8">
                        <p>If you're sending the email by directly contacting a remote SMTP server then you won't be able to do that on a free account. The one exception, I believe, is Gmail - you can connect to their SMTP servers even on a free account.</p>
<p>If you're attempting to use your own SMTP server to send emails out (which I would recommend - many mail servers are starting to distrust connections from hosts they don't recognise as other mail servers) then again, you'll have to use Gmail from a free account. Paid accounts should be able to connect out without restriction.</p>
<p>If you are using Gmail, it's possible the firewall rules which allow it need updating by the PA devs, but please confirm either way first so they know whether they should be looking into it.</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5630_creator_details">
                            
                                
                                    <img src="/static/anywhere/images/star.gif" alt="Beloved premium user" title="Beloved premium user"/>
                                
                            
                            Cartroo
                            |
                            638
                            posts
                            |
                            
                        </span>
                        <span id="id_post_5630_created_date">
                            July 25, 2013, 4:25 p.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5630">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5632" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5632_content_text" class="span8">
                        <p>IIRC gmail changes the ip of its smtp server from time-to-time. I suspect that this is what's happened and that the devs need to change the firewall rules. (I would have thought a simple script, using dig, could make sure that the firewall was automatically updated.)</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5632_creator_details">
                            
                                
                                    <img src="/static/anywhere/images/star.gif" alt="Beloved premium user" title="Beloved premium user"/>
                                
                            
                            rcs1000
                            |
                            123
                            posts
                            |
                            
                        </span>
                        <span id="id_post_5632_created_date">
                            July 25, 2013, 4:30 p.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5632">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5634" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5634_content_text" class="span8">
                        <p>Yup, the firewall rules needed updating -- I've just run the script and it should work now.</p>
<p>@rcs1000 unfortunately it's not something we can do a simple script for, as it interacts with the rules required to handle the looser rules for paying customers.</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5634_creator_details">
                            
                                <img src="/static/anywhere/images/staff.png" alt="Staff" title="Staff"/>
                            
                            giles
                            |
                            866
                            posts
                            |
                            
                                PythonAnywhere staff
                                |
                            
                        </span>
                        <span id="id_post_5634_created_date">
                            July 25, 2013, 5:13 p.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5634">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5640" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5640_content_text" class="span8">
                        <p>Thanks for the replies. I am still getting the same error and no emails are getting sent. I am using gmail.</p>
<p>To provide you with more info, here are my Mail settings (actual username/password were changed, obviously, but I am certain that they are correct):</p>
<p>mail = auth.settings.mailer
mail.settings.server = 'smtp.gmail.com:587'
mail.settings.sender = 'username@gmail.com'
mail.settings.login = 'username:password'</p>
<p>Giles, it seems what whatever script magic you performed did not work or there is something else at play (or gmail changed their IPs again). Thanks for the help.</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5640_creator_details">
                            
                                
                            
                            dostal
                            |
                            4
                            posts
                            |
                            
                        </span>
                        <span id="id_post_5640_created_date">
                            July 26, 2013, 10:28 a.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5640">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5648" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5648_content_text" class="span8">
                        <p>I think they might have changed it again :-(</p>
<p>Could you give it another go?</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5648_creator_details">
                            
                                <img src="/static/anywhere/images/staff.png" alt="Staff" title="Staff"/>
                            
                            giles
                            |
                            866
                            posts
                            |
                            
                                PythonAnywhere staff
                                |
                            
                        </span>
                        <span id="id_post_5648_created_date">
                            July 26, 2013, 2:30 p.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5648">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5677" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5677_content_text" class="span8">
                        <p>I tested it again just now (July 29 9:15am GMT) and still nothing. Same error. Thanks for your effort. I wonder if there is a way to make the approach IP independent to avoid having to run your scripts all the time...</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5677_creator_details">
                            
                                
                            
                            dostal
                            |
                            4
                            posts
                            |
                            
                        </span>
                        <span id="id_post_5677_created_date">
                            July 29, 2013, 8:15 a.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5677">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5682" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5682_content_text" class="span8">
                        <p>Packet filtering always happens on IP addresses. I've just added the current SMTP and IMAP servers for gmail to the filter rules. For direct access to them on a permanent basis you could always upgrade to a paid account since they skip the filtering. </p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5682_creator_details">
                            
                                <img src="/static/anywhere/images/staff.png" alt="Staff" title="Staff"/>
                            
                            hansel
                            |
                            435
                            posts
                            |
                            
                                PythonAnywhere staff
                                |
                            
                        </span>
                        <span id="id_post_5682_created_date">
                            July 29, 2013, 11:09 a.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5682">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5692" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5692_content_text" class="span8">
                        <p>Ok, this seems to have fixed it (at least for now :) ) and I am able to send emails again. I will let you know if anything else pops up. Thanks for the help everyone.</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5692_creator_details">
                            
                                
                            
                            dostal
                            |
                            4
                            posts
                            |
                            
                        </span>
                        <span id="id_post_5692_created_date">
                            July 29, 2013, 5:35 p.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5692">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5946" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5946_content_text" class="span8">
                        <p>I can only send one email and then I get [Errno 101] Network is unreachable.</p>
<p>I am using Gmail's smtp server. </p>
<p>It would be nice if PA manages to fix that firewall issue soon!</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5946_creator_details">
                            
                                
                            
                            stocksolutions
                            |
                            3
                            posts
                            |
                            
                        </span>
                        <span id="id_post_5946_created_date">
                            Aug. 17, 2013, 11:59 a.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5946">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5973" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5973_content_text" class="span8">
                        <p>Same problem, I'm unable to send emails with gmail smtp
Could you please confirm if the problem is fixed for paying customers?</p>
<p>Thank you</p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5973_creator_details">
                            
                                
                                    <img src="/static/anywhere/images/star.gif" alt="Beloved premium user" title="Beloved premium user"/>
                                
                            
                            espern
                            |
                            3
                            posts
                            |
                            
                        </span>
                        <span id="id_post_5973_created_date">
                            Aug. 19, 2013, 1:48 p.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5973">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    
        <div class="row">
            <div id="id_post_5977" class="span8 offset3 post">
                <div class="row">
                    <div id="id_post_5977_content_text" class="span8">
                        <p>Paid accounts don't have filtered internet access. We only introduced filtering for free accounts because people were using us to spam and or DDOS other sites. We offer a no quibble refund process so you can just try it and see. </p>
                    </div>
                </div>
                <div class="row">
                    <div class="span7 post_metadata">
                        <span id="id_post_5977_creator_details">
                            
                                <img src="/static/anywhere/images/staff.png" alt="Staff" title="Staff"/>
                            
                            hansel
                            |
                            435
                            posts
                            |
                            
                                PythonAnywhere staff
                                |
                            
                        </span>
                        <span id="id_post_5977_created_date">
                            Aug. 19, 2013, 2:33 p.m.
                        </span>
                        |
                        <a href="https://www.pythonanywhere.com/forums/topic/790/#id_post_5977">permalink</a>
                    </div>
                    <div class="span1">
                        
                    </div>
                </div>
            </div>
        </div>
    

    




        <div id="id_footer" class="container">

            <footer id="id_copyright_div">
                <p>
                    Copyright &copy; 2013 PythonAnywhere LLP
                    &mdash;
                    <a href="/terms/">Terms</a>
                    &mdash;
                    <a href="/privacy/">Privacy</a><br/>
                    "Python" is a registered trademark of the Python Software Foundation.
                </p>
            </footer>

        </div>

        
        

        <div id="id_feedback_dialog" title="Help us improve" style="display:none">
    <div id="id_feedback_dialog_blurb_big" class="dialog_blurb_big">
        It's always a pleasure to hear from you!
    </div>
    <div id="id_feedback_dialog_blurb_small">
        Ask us a question, or tell us what you love or hate about PythonAnywhere.<br/>
        We'll get back to you over email ASAP.
    </div>
    <textarea id="id_feedback_dialog_text" rows="6"></textarea>
    <input id="id_feedback_dialog_email_address" type="text" class="default_prompt"/>
    <div id="id_feedback_dialog_error" class="pa_hidden">
        Sorry, there was an error connecting to the server. <br/>Please try again in a few moments...
    </div>
    <div class="dialog_buttons">
        <img id="id_feedback_dialog_spinner" src="/static/anywhere/images/spinner-small.gif" />
        <button class="btn btn-primary" id="id_feedback_dialog_ok_button">OK</button>
        <button class="btn" id="id_feedback_dialog_cancel_button">Cancel</button>
    </div>
</div>


        <!-- Le javascript
        ================================================== -->
        <!-- Placed at the end of the document so the pages load faster -->
        <script type="text/javascript" src="/static/jquery/jquery-1.7.1.min.js"></script>
        <script type="text/javascript" src="/static/jquery/jquery-ui-1.8.11.custom.min.js"></script>
        <script src="/static/bootstrap/js/bootstrap-transition.js"></script>
        <script src="/static/bootstrap/js/bootstrap-alert.js"></script>
        <script src="/static/bootstrap/js/bootstrap-modal.js"></script>
        <script src="/static/bootstrap/js/bootstrap-dropdown.js"></script>
        <script src="/static/bootstrap/js/bootstrap-scrollspy.js"></script>
        <script src="/static/bootstrap/js/bootstrap-tab.js"></script>
        <script src="/static/bootstrap/js/bootstrap-tooltip.js"></script>
        <script src="/static/bootstrap/js/bootstrap-popover.js"></script>
        <script src="/static/bootstrap/js/bootstrap-button.js"></script>
        <script src="/static/bootstrap/js/bootstrap-collapse.js"></script>
        <script src="/static/bootstrap/js/bootstrap-carousel.js"></script>
        <script src="/static/bootstrap/js/bootstrap-typeahead.js"></script>

        <script type="text/javascript">
            var urls = {};
            var Anywhere = {};
            Anywhere.urls = {};
        </script>
        <script type="text/javascript" src="/static/anywhere/scripts/ajax_utils.js"></script>

        <script type="text/javascript" src="/static/anywhere/scripts/feedback_dialog.js"></script>
        
        <script type="text/javascript">
            $(function() {
                $.extend(
                    urls,
                    {
                        feedback: '/feedback/submit/'
                    }
                );
                
                    Anywhere.FeedbackDialog.Initialise(urls, true);
                
            });
        </script>

        <script type="text/javascript">

            var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-18014859-6']);
            _gaq.push(['_trackPageview']);

            (function() {
                var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
            })();

        </script>

        



    </body>
</html>
